<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Visits</title>
</h:head>
<body>
	<ui:composition template="/pages/common/commonLayout.xhtml">
		<ui:define name="content">
			<h:form>
				<p:panel header="Nasze wizyty" toggleable="true" closable="false" toggleSpeed="500" 
					closeSpeed="500" widgetVar="panel1" style="margin-bottom:20px">
					<p:dataTable var="visit" value="#{visitMB.ourVisits}" paginator="true"
                        rows="10">
						<p:column headerText="Poczatek">
							<h:outputText value="#{visit.dateStart}" />
						</p:column>
						<p:column headerText="Pacjent">
							<h:outputText value="#{visit.patientName}" />
						</p:column>
						<p:column headerText="Lekarz">
							<h:outputText value="#{visit.schedule.doctor.fullName}" />
						</p:column>
						<p:column headerText="Specjalizacja">
							<h:outputText value="#{visit.schedule.doctor.spec.label}" />
						</p:column>
						<p:column headerText="Akcje">
							<p:commandButton icon="ui-icon-search" action="/pages/visits/showChosenVisit?faces-redirect=true">
								<f:setPropertyActionListener target="#{visitMB.chosenVisit}" value="#{visit}"/>
							</p:commandButton>
						</p:column>
					</p:dataTable>
				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</body>
</html>
